const Router = require("koa-router");
const { verifyToken } = require("../middeleware/auth.middleware");

const fileRouter = new Router({ prefix: "/upload" });

const { avatarHandler } = require("../middeleware/file.middleware");

const { saveAvatarInfo } = require("../controller/file.controller");

// 上传图片
fileRouter.post(
  "/avatar/:goods_id",
  verifyToken,
  avatarHandler,
  saveAvatarInfo
);

module.exports = fileRouter;
